package com.avengers.common.model.base;

import com.avengers.core.model.DbColumn;
import com.avengers.common.model.Account;
import com.jfinal.plugin.activerecord.IBean;

/**
 * @author avengers_jfinal
 * @since 2019-03-11
 */
@SuppressWarnings({"serial", "unchecked"})
public class BaseAccount<M extends BaseAccount<M>> extends BaseModel<M> implements IBean {
    public static final String TABLE_NAME = "account";

    /**
     * db table columns
     */
    public enum Column implements DbColumn {
        /**
         * id
         **/
        id,
        /**
         * 会员ID号 
         **/
        user_id,
        /**
         * userName
         **/
        user_name,
        /**
         * 邮箱 
         **/
        email,
        /**
         * 余额 
         **/
        balance,
        /**
         * 冻结金额 
         **/
        freeze,
        /**
         * 积分 
         **/
        credit,
        /**
         * phone
         **/
        phone,
        /**
         * password
         **/
        password,
        /**
         * salt
         **/
        salt,
        /**
         * 安全码 
         **/
        safe_code,
        /**
         * status
         **/
        status,
        /**
         * 欠票金额，竞价第二名返款的金额累加 
         **/
        deduct_invoice_amount,
        /**
         * 当月享受优惠起始时间 
         **/
        auction_coupon_start_time,
        /**
         * 享受优惠结束时间 
         **/
        auction_coupon_end_time,
        /**
         * 上月累计竞价消费 
         **/
        auction_expense_last_month,
        /**
         * 上月累计竞价消费修改时间 
         **/
        auction_expense_update_time,
        /**
         * 是否存在违约 
         **/
        has_renege,
        /**
         * version
         **/
        version,
        /**
         * ip
         **/
        ip,
        /**
         * level
         **/
        level,
        /**
         * QQ，可选 
         **/
        qq,
        /**
         * 微信，可选 
         **/
        wechat,
        /**
         * 微信二维码 
         **/
        wechat_qrcode,
        /**
         * 登陆尝试次数 
         **/
        login_attempts,
        /**
         * 找回密码尝试次数 
         **/
        retrieve_attempts,
        /**
         * 是否随机用户名，是的话可修改 
         **/
        is_rand_user_name,
        /**
         * 实名类型 
         **/
        real_name_type,
        /**
         * 关联的个人/企业认证ID 
         **/
        real_name_id,
        /**
         * 实名认证状态 
         **/
        real_name_status,
        /**
         * 不为空则为实名截止时间 
         **/
        real_name_end_time,
        /**
         * 是否重新实名 
         **/
        is_re_real_name,
        /**
         * 微信授权用户唯一标识，用户公众号通知 
         **/
        wx_open_id,
        /**
         * 微信用户统一标识，用于网站登录 
         **/
        wx_union_id,
        /**
         * 邀请人用户ID 
         **/
        invite_user_id,
        /**
         * 注册来源 
         **/
        from,
        /**
         * 人脸识别状态，NONE:无需验证，WAIT:等待验证，SUCCESS:验证成功 
         **/
        face_verify_status,
        /**
         * 上次活动时间 
         **/
        last_active_time,
        /**
         * createTime
         **/
        create_time,
        /**
         * updateTime
         **/
        update_time
    }

    @Override
    protected boolean containsColumn(String name) {
        for (Column column : Column.values()) {
            if (column.name().equals(name)) {
                return true;
            }
        }
        return false;
    }

    private static String configName;

    public static Account init() {
        return new Account();
    }

    @Override
    public String getTableName() {
        return TABLE_NAME;
    }

    protected static void setConfigName(String configName) {
        BaseAccount.configName = configName;
    }

    @Override
    protected String getConfigName() {
        return BaseAccount.configName;
    }


	public M setId(java.lang.Integer id) {
		set(Column.id.name(), id);
		return (M) this;
	}
	
	public java.lang.Integer getId() {
		return getInt(Column.id.name());
	}

	public M setUserId(java.lang.String userId) {
		set(Column.user_id.name(), userId);
		return (M) this;
	}
	
	public java.lang.String getUserId() {
		return getStr(Column.user_id.name());
	}

	public M setUserName(java.lang.String userName) {
		set(Column.user_name.name(), userName);
		return (M) this;
	}
	
	public java.lang.String getUserName() {
		return getStr(Column.user_name.name());
	}

	public M setEmail(java.lang.String email) {
		set(Column.email.name(), email);
		return (M) this;
	}
	
	public java.lang.String getEmail() {
		return getStr(Column.email.name());
	}

	public M setBalance(java.math.BigDecimal balance) {
		set(Column.balance.name(), balance);
		return (M) this;
	}
	
	public java.math.BigDecimal getBalance() {
		return get(Column.balance.name());
	}

	public M setFreeze(java.math.BigDecimal freeze) {
		set(Column.freeze.name(), freeze);
		return (M) this;
	}
	
	public java.math.BigDecimal getFreeze() {
		return get(Column.freeze.name());
	}

	public M setCredit(java.lang.Integer credit) {
		set(Column.credit.name(), credit);
		return (M) this;
	}
	
	public java.lang.Integer getCredit() {
		return getInt(Column.credit.name());
	}

	public M setPhone(java.lang.String phone) {
		set(Column.phone.name(), phone);
		return (M) this;
	}
	
	public java.lang.String getPhone() {
		return getStr(Column.phone.name());
	}

	public M setPassword(java.lang.String password) {
		set(Column.password.name(), password);
		return (M) this;
	}
	
	public java.lang.String getPassword() {
		return getStr(Column.password.name());
	}

	public M setSalt(java.lang.String salt) {
		set(Column.salt.name(), salt);
		return (M) this;
	}
	
	public java.lang.String getSalt() {
		return getStr(Column.salt.name());
	}

	public M setSafeCode(java.lang.String safeCode) {
		set(Column.safe_code.name(), safeCode);
		return (M) this;
	}
	
	public java.lang.String getSafeCode() {
		return getStr(Column.safe_code.name());
	}

	public M setStatus(java.lang.Integer status) {
		set(Column.status.name(), status);
		return (M) this;
	}
	
	public java.lang.Integer getStatus() {
		return getInt(Column.status.name());
	}

	public M setDeductInvoiceAmount(java.math.BigDecimal deductInvoiceAmount) {
		set(Column.deduct_invoice_amount.name(), deductInvoiceAmount);
		return (M) this;
	}
	
	public java.math.BigDecimal getDeductInvoiceAmount() {
		return get(Column.deduct_invoice_amount.name());
	}

	public M setAuctionCouponStartTime(java.util.Date auctionCouponStartTime) {
		set(Column.auction_coupon_start_time.name(), auctionCouponStartTime);
		return (M) this;
	}
	
	public java.util.Date getAuctionCouponStartTime() {
		return getDate(Column.auction_coupon_start_time.name());
	}

	public M setAuctionCouponEndTime(java.util.Date auctionCouponEndTime) {
		set(Column.auction_coupon_end_time.name(), auctionCouponEndTime);
		return (M) this;
	}
	
	public java.util.Date getAuctionCouponEndTime() {
		return getDate(Column.auction_coupon_end_time.name());
	}

	public M setAuctionExpenseLastMonth(java.math.BigDecimal auctionExpenseLastMonth) {
		set(Column.auction_expense_last_month.name(), auctionExpenseLastMonth);
		return (M) this;
	}
	
	public java.math.BigDecimal getAuctionExpenseLastMonth() {
		return get(Column.auction_expense_last_month.name());
	}

	public M setAuctionExpenseUpdateTime(java.util.Date auctionExpenseUpdateTime) {
		set(Column.auction_expense_update_time.name(), auctionExpenseUpdateTime);
		return (M) this;
	}
	
	public java.util.Date getAuctionExpenseUpdateTime() {
		return getDate(Column.auction_expense_update_time.name());
	}

	public M setHasRenege(java.lang.Boolean hasRenege) {
		set(Column.has_renege.name(), hasRenege);
		return (M) this;
	}
	
	public java.lang.Boolean getHasRenege() {
		return get(Column.has_renege.name());
	}

	public M setVersion(java.lang.Integer version) {
		set(Column.version.name(), version);
		return (M) this;
	}
	
	public java.lang.Integer getVersion() {
		return getInt(Column.version.name());
	}

	public M setIp(java.lang.String ip) {
		set(Column.ip.name(), ip);
		return (M) this;
	}
	
	public java.lang.String getIp() {
		return getStr(Column.ip.name());
	}

	public M setLevel(java.lang.String level) {
		set(Column.level.name(), level);
		return (M) this;
	}
	
	public java.lang.String getLevel() {
		return getStr(Column.level.name());
	}

	public M setQq(java.lang.String qq) {
		set(Column.qq.name(), qq);
		return (M) this;
	}
	
	public java.lang.String getQq() {
		return getStr(Column.qq.name());
	}

	public M setWechat(java.lang.String wechat) {
		set(Column.wechat.name(), wechat);
		return (M) this;
	}
	
	public java.lang.String getWechat() {
		return getStr(Column.wechat.name());
	}

	public M setWechatQrcode(java.lang.String wechatQrcode) {
		set(Column.wechat_qrcode.name(), wechatQrcode);
		return (M) this;
	}
	
	public java.lang.String getWechatQrcode() {
		return getStr(Column.wechat_qrcode.name());
	}

	public M setLoginAttempts(java.lang.Integer loginAttempts) {
		set(Column.login_attempts.name(), loginAttempts);
		return (M) this;
	}
	
	public java.lang.Integer getLoginAttempts() {
		return getInt(Column.login_attempts.name());
	}

	public M setRetrieveAttempts(java.lang.Integer retrieveAttempts) {
		set(Column.retrieve_attempts.name(), retrieveAttempts);
		return (M) this;
	}
	
	public java.lang.Integer getRetrieveAttempts() {
		return getInt(Column.retrieve_attempts.name());
	}

	public M setRandUserName(java.lang.Boolean isRandUserName) {
		set(Column.is_rand_user_name.name(), isRandUserName);
		return (M) this;
	}
	
	public java.lang.Boolean getRandUserName() {
		return get(Column.is_rand_user_name.name());
	}

	public M setRealNameType(java.lang.String realNameType) {
		set(Column.real_name_type.name(), realNameType);
		return (M) this;
	}
	
	public java.lang.String getRealNameType() {
		return getStr(Column.real_name_type.name());
	}

	public M setRealNameId(java.lang.Integer realNameId) {
		set(Column.real_name_id.name(), realNameId);
		return (M) this;
	}
	
	public java.lang.Integer getRealNameId() {
		return getInt(Column.real_name_id.name());
	}

	public M setRealNameStatus(java.lang.String realNameStatus) {
		set(Column.real_name_status.name(), realNameStatus);
		return (M) this;
	}
	
	public java.lang.String getRealNameStatus() {
		return getStr(Column.real_name_status.name());
	}

	public M setRealNameEndTime(java.util.Date realNameEndTime) {
		set(Column.real_name_end_time.name(), realNameEndTime);
		return (M) this;
	}
	
	public java.util.Date getRealNameEndTime() {
		return getDate(Column.real_name_end_time.name());
	}

	public M setReRealName(java.lang.Boolean isReRealName) {
		set(Column.is_re_real_name.name(), isReRealName);
		return (M) this;
	}
	
	public java.lang.Boolean getReRealName() {
		return get(Column.is_re_real_name.name());
	}

	public M setWxOpenId(java.lang.String wxOpenId) {
		set(Column.wx_open_id.name(), wxOpenId);
		return (M) this;
	}
	
	public java.lang.String getWxOpenId() {
		return getStr(Column.wx_open_id.name());
	}

	public M setWxUnionId(java.lang.String wxUnionId) {
		set(Column.wx_union_id.name(), wxUnionId);
		return (M) this;
	}
	
	public java.lang.String getWxUnionId() {
		return getStr(Column.wx_union_id.name());
	}

	public M setInviteUserId(java.lang.String inviteUserId) {
		set(Column.invite_user_id.name(), inviteUserId);
		return (M) this;
	}
	
	public java.lang.String getInviteUserId() {
		return getStr(Column.invite_user_id.name());
	}

	public M setFrom(java.lang.String from) {
		set(Column.from.name(), from);
		return (M) this;
	}
	
	public java.lang.String getFrom() {
		return getStr(Column.from.name());
	}

	public M setFaceVerifyStatus(java.lang.String faceVerifyStatus) {
		set(Column.face_verify_status.name(), faceVerifyStatus);
		return (M) this;
	}
	
	public java.lang.String getFaceVerifyStatus() {
		return getStr(Column.face_verify_status.name());
	}

	public M setLastActiveTime(java.util.Date lastActiveTime) {
		set(Column.last_active_time.name(), lastActiveTime);
		return (M) this;
	}
	
	public java.util.Date getLastActiveTime() {
		return getDate(Column.last_active_time.name());
	}

	public M setCreateTime(java.util.Date createTime) {
		set(Column.create_time.name(), createTime);
		return (M) this;
	}
	
	public java.util.Date getCreateTime() {
		return getDate(Column.create_time.name());
	}

	public M setUpdateTime(java.util.Date updateTime) {
		set(Column.update_time.name(), updateTime);
		return (M) this;
	}
	
	public java.util.Date getUpdateTime() {
		return getDate(Column.update_time.name());
	}
}
